package fifth;

public class Fruit2
{

        public double weight;
        public String color;
        public String name;

        public void info(String name,double weight,String color) {
            System.out.println(name+"-----的重量为：" + weight + "*****"+name+"----的颜色为:" + color );
        }
    public static void main(String [] args)
    {
        Apple a1=new Apple();
        Banana b1=new Banana();
        Mangguo m1=new Mangguo();
        a1.name="Apple";
        a1.weight=2;
        a1.color="red";
        b1.weight= 1.5;
        b1.color="yellow";
        b1.name = "Banana";
        m1.weight=1.8;
        m1.color="orange";
        m1.name = "Mangguo";
        a1.info(a1.name,a1.weight,a1.color);
        b1.info(b1.name,b1.weight,b1.color);
        m1.info(m1.name,m1.weight,m1.color);
    }
}
